function login() {
    var o = $("#accountNo").val(),
    e = $("#password").val();
    $("#message").html(""),
    "" != o ? "" != e ? ($("#btnSubmit").val("正在登录..."), $.ajax({
        url: "/index/login",
        method: "POST",
        data: {
            accountNo: o,
            password: e
        },
        success: function(o) {
            if (o.code == 1) {
                if (o.group_id==2) {
                   $("#btnSubmit").val("正在进入系统..."), window.location.href = "/index/beater/index.html"  
                }else{
                   $("#btnSubmit").val("正在进入系统..."), window.location.href = "/index/index/index.html"  
              }
            }else{
                $("#message").html(o.msg), $("#btnSubmit").val("登录")
            }
            //o.code == 1 ? ($("#btnSubmit").val("正在进入系统..."), window.location.href = "/index/index/index.html") : ($("#message").html(o.msg), $("#btnSubmit").val("登录"))
        }
    })) : $("#message").html("请输入密码！") : $("#message").html("请输入用户名！")
}
$().ready(function() {
    $("#btnSubmit").on("click",
    function() {
        login()
    }),
    $(window.document.body).keydown(function(o) {
        13 == o.keyCode && $("#btnSubmit").click()
    });
    switch (BrowserDetect.browser) {
    case "Chrome":
    case "Firefox":
        $("#notification").hide();
        break;
    default:
        $("#notification").show()
    }
});